package com.partvoyage.client.mvp2.view.carte;

import com.google.gwt.maps.client.MapWidget;
import com.google.gwt.maps.client.control.LargeMapControl;
import com.google.gwt.user.client.ui.Widget;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.HLayout;

public class CarteView extends Canvas implements CartePresenter.Display {

	private MapWidget map;

	public CarteView() {
		super();
		this.setWidth100();
		this.setHeight100();
	}

	public MapWidget getMap() {
		return map;
	}

	public void chargerCarte(HLayout container) {

		map = new MapWidget();
		// Add some controls for the zoom level
		map.addControl(new LargeMapControl());
		map.clearOverlays();
		addChild(map);
		map.setHeight("600px");
		map.setWidth("1000px");
		container.addChild(this);

	}

	public void supprimerPointCarte() {
		map.clearOverlays();
	}

	public Widget asWidget() {
		return this;
	}

	@Override
	public void nettoyerLaCarte() {
		map.clearOverlays();

	}
}
